package com.ruoyi.controller;


import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 首页Controller
 *
 * @author ruoyi
 * @date 2024-05-13
 */
@RestController
@RequestMapping("/system/index")
public class IndexController extends BaseController {

    @Autowired
    private IndexService indexService;


    @PreAuthorize("@ss.hasAnyPermi('system:ordersdetail:allData')")
    @GetMapping("/allData")
    public AjaxResult allData(){
        Map<String, Object> data = indexService.getAllData();
        data.forEach((key, value) -> {
            System.out.println("Key: " + key + ", Value: " + value);
        });
        return AjaxResult.success(data);
    }

}
